package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanhua.dubbo.mappers.SettingsMapper;
import com.tanhua.model.domain.db.Settings;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author maorf
 * @version 1.0
 */
@DubboService
public class SettingsApiImpl implements SettingsApi {

    @Autowired
    SettingsMapper settingsMapper;

    @Override
    public Settings findSetting(Long id) {
        LambdaQueryWrapper<Settings> settingsLambdaQueryWrapper = new LambdaQueryWrapper<>();
        settingsLambdaQueryWrapper.eq(Settings::getUserId,id);
        Settings settings = settingsMapper.selectOne(settingsLambdaQueryWrapper);
        return settings;
    }
}
